根据手机号导入用户会员卡
商户可通过加密后的用户手机号,将存量会员通过接口导入至微信侧后台。
请求参数 | 类型 | 描述 |
---|---|---|
card_id | string | 会员卡ID |
json | object | 声明请求的JSON 数据结构 |
encrypted_phone_number | string | 用户加密手机号 |
code | string | 会员卡code |
out_request_no | string | 商户请求单号 |
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->phoneMembercard->import->postAsync([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0aaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
'code' => '478515832665',
'out_request_no' => '100002322019090134234sfdf',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}/phone-membercard/import')->postAsync([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0aaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
'code' => '478515832665',
'out_request_no' => '100002322019090134234sfdf',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}/phone-membercard/import']->postAsync([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0aaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
'code' => '478515832665',
'out_request_no' => '100002322019090134234sfdf',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->phoneMembercard->import->post([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0aaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
'code' => '478515832665',
'out_request_no' => '100002322019090134234sfdf',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/phone-membercard/import')->post([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0aaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
'code' => '478515832665',
'out_request_no' => '100002322019090134234sfdf',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/phone-membercard/import']->post([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0aaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
'code' => '478515832665',
'out_request_no' => '100002322019090134234sfdf',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
code | string | 会员卡code |
参阅 官方文档